package thread;

/**
 * Thread 线程
 * 普通创建
 */
public class ThreadDemo1 {
    public static void main(String[] args) {
            Thread1 t1=new Thread1();
            Thread2 t2=new Thread2();
            t1.start();
            t2.start();

    }
}

class Thread1 extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println("Who's there?");
        }
    }
}
class Thread2 extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println("Open the door! ");
        }
    }
}